using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;

[assembly: CLSCompliant(true)]

namespace Isv1.ASClientExtensions
{
    [PlugInAttribute]
    public class ASClientExtension
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "environment")]
        public ASClientExtension()
        {
            Context.Server.SessionOpened += new EventHandler(this.SessionOpened);
            Context.Server.SessionClosing += new EventHandler(this.SessionClosing);
            
            //Verify and set environment for ClientExtensions
            AuthoringAndManagement environment = new AuthoringAndManagement();
        }

        //~ASClientExtension()
        //{
        //    Close and discard any object that requires clean-up
        //}

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "session")]
        public void SessionOpened(object sender, EventArgs e)
        {
            // This will subscribe to the events.
            SessionMgr session = new SessionMgr();
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")]
        public void SessionClosing(object sender, EventArgs e)
        {
      //    Close and discard any object that requires clean-up
        }
    }
}

